home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 52
/
Volume 52 - JOGO DISK .iso
/
Games
/
shopdrop.swf
/
scripts
/
__Packages
/
smashing
/
Phys.as
< prev
next >
Wrap
Text File
|
2007-09-27
|
963b
|
39 lines
class smashing.Phys
{
static var gr = 20;
static var fr = 0.1;
static var bf = 0.7;
static var height = 370;
static var width = 600;
static var TWOPI = 6.283185307179586;
static var bInit = smashing.Phys.init();
function Phys()
{
}
static function drag(f, t, nFric)
{
if(nFric == undefined)
{
nFric = smashing.Phys.fr;
}
return f * (- Math.pow(1 - nFric,t * 27) + 1);
}
static function bounce(v, n)
{
var _loc2_ = v.reverse();
var _loc1_ = n.multiply(n.dot(_loc2_));
v.x = _loc1_.x * smashing.Phys.bf + (_loc1_.x - _loc2_.x);
v.y = _loc1_.y * smashing.Phys.bf + (_loc1_.y - _loc2_.y);
}
static function get up()
{
return smashing.Phys.pUp;
}
static function init()
{
smashing.Phys.pUp = new smashing.Point(0,-1);
smashing.Phys.pHoriz = new smashing.Point(1,0);
return true;
}
}